module http {
	export class Http {
		public constructor() {
		}

		/**
		 * post
		 */
		public static post(url: string, params?: Array<any>, complete?: Function, error?: Function, prohress?: Function) {
			var send = '';
			if (params !== undefined) {
				for (var i in params) {
					send = i + "=" + params[i] + "&";
				}
			}

			var request = new egret.HttpRequest();
			request.responseType = egret.HttpResponseType.TEXT;
			request.open(url, egret.HttpMethod.POST);
			request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
			request.send(send);
			request.addEventListener(egret.Event.COMPLETE, complete, this);
			request.addEventListener(egret.IOErrorEvent.IO_ERROR, error, this);
			request.addEventListener(egret.ProgressEvent.PROGRESS, prohress, this);
		}
	}
}